Skip to content

chore: fold in 5 safe review-findings fixes (dedup/stale-doc/dead-code) - #418

Merged
zzylol merged 1 commit into
mainfrom
chore/dedup-review-findings
Jul 27, 2026
Merged

zzylol merged 1 commit into
mainfrom
chore/dedup-review-findings

Conversation

@zzylol

@zzylol zzylol commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Small, independent fixes from the cross-repo dead-code/duplication review — findings #2, #3, #4, #5, #9 (the ones judged safe/mechanical; #6-#8 were info-only, #1 landed separately in #416):

Test plan

  • cargo build --workspace — clean
  • cargo test -p data_plane --lib — 913 passed
  • cargo test -p control_plane --lib — 766 passed, 1 known pre-existing failure (invalid_sketch_type_override_falls_back_to_default), confirmed identical on origin/main
  • cargo clippy -p data_plane --lib / -p control_plane --lib — identical warning counts to baseline
  • rustfmt on touched files only

🤖 Generated with Claude Code

From the cross-repo dead-code/duplication review:

- sketch_reducer.rs: the FrequencyTopk `topk` sort (summed counts from a
  per-window HashMap) had no tie-break, so equal-count keys ordered
  non-deterministically across runs. Add the same deterministic
  key-ascending tie-break summary_executor.rs's topk_ranked already has.
- cost_model.rs: fix a stale doc claiming a `BindCountSketchOnTopK`
  pre-pass still binds `TopK{accuracy: Exact}` in lower.rs -- that rule
  was deleted; lower.rs's own doc already says the correct thing
  (falls through to implement_tree_in_with's Logical fallback, a
  genuine open asap-plan gap, ASAPController#151).
- optimizer/rules/mod.rs: delete dead `ENV_USE_TYPED_SKETCH_ALGEBRA`/
  `typed_sketch_algebra_enabled()` (zero callers), and fix
  sketch_algebra/mod.rs's crate doc, which still claimed this env var
  gates the typed L3->L4 binding path -- that binding actually runs
  unconditionally from main.rs today; the real env gate in this area
  (`USE_TYPED_STAGE_SPLIT`) is on the downstream L4->L5 stage-split step.
- sketch_reducer.rs: `evaluate`'s sister doc said the string-dispatch
  entry point is "retained for legacy callers" -- there are none in
  production (engine.rs calls the typed `evaluate_for_capability`
  exclusively); it's kept because the query-path test suite still
  exercises it via PromQL function-name strings. Clarified rather than
  migrating 18 test call sites (out of scope for this round).
- http.rs: delete ~120 lines of commented-out dead
  PrometheusResponse/format_results_as_http_response code.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zzylol
zzylol merged commit fa55207 into main Jul 27, 2026
zzylol added a commit that referenced this pull request Jul 27, 2026
…t plan

Rebased onto current main (was 27 commits behind, predating #416/#417/#418)
and updated the doc's content to match:

- Status note: SummaryExecutor now covers the Frequency family and
  ExactAgg(Sum/Increase) candidate matching + coverage tracking, not just
  quantile/cardinality -- these landed since the doc was last synced.
- "Today"/gap list: gap 2 (merge only existed for ExactAgg) and gap 3
  (nothing checked param agreement) are now resolved on the new path,
  marked accordingly rather than left as open problems.
- SidHandle/GroupState table entries: updated to describe the actual
  enum shape (Sketch/ExactAgg variants), not the original sketch-only
  struct design.
- New "Architecture reference" section citing ASAPController design.md's
  "Serving-time execution" section directly -- the planning-vs-serving
  split this doc's Rollout section builds on.
- "Rollout" section: replaces "still open" with an actual plan. Corrects
  a real error in the previous version -- it named
  `implement_promql_for_asap_tier` as "the seam" for tree construction,
  but that function uses the naive DefaultCostModel and has a documented,
  tracked gap where it can't realize the Frequency intent at all. The
  correct seam is `sketch_algebra::lower::bind_query_expr`
  (ControlPlaneCostModel, what main.rs's real production pipeline uses).
  Also documents why rate()/topk-over-rate/outer-agg-fold must be
  excluded from the shadow comparison entirely (not just deprioritized)
  and why shadow mode -- not a cutover -- is this phase's actual scope.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@zzylol
zzylol deleted the chore/dedup-review-findings branch September 12, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant